package day01;

import java.util.Random;

/**
 * 成绩单练习
 * 1.随机生成小明的本学期成绩（一共6门课程， 最大100分），
 *      并显示
 * 2.判断每科成绩分数，低于60不及格，高于60低于70及格，70-80良 80-100优
 */
public class HomeWork {
    public static void main(String[] args) {
        String[] subject = {"高数","英语","语文","体育","化学","政治"};
        int score=0;
        Random random= new Random();
        for (String s : subject) {
            int grade=random.nextInt(100);
            score = score + grade;
            System.out.println(s + " " + grade);
            if (grade<60){
                System.out.println("不及格");
            } else if (grade>=60&grade<70){
                System.out.println("jige ");
            } else if (grade>=70&grade<80){
                System.out.println("liang");
            }else {
                System.out.println("youxiu");
            }
        }

        System.out.println("总成绩：" + score);
        System.out.println("平均成绩：" + score / 6.0);
    }
}
